#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include "ui_dialog.h" // 包含正确的头文件
#include<QMessageBox>
#include "login.h"
#include "register.h"
#include "menuview.h"   //点菜者登录
#include "admin.h"  //管理者登录

//避免头文件互相引用导致循环引用，所以用前向声明
class Register;
class menuview;

QT_BEGIN_NAMESPACE
namespace Ui {
class Dialog;
}
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();

    //给Register类获取UserManager并进行更改（使用引用&）
    UserManager* getUserManager()
    {
        return usermanager;
    }

    //点菜界面
    void menu();

    menuview* returnMenuview(){return menuview1;}
    admin* returnAdmin(){return admin1;}
    UserManager* returnUserManager() {return usermanager;}
    Register* returnRegister() {return register_s;}


private slots:
    void on_pushButton_clicked();

    void on_pushButton_1_clicked();

private:
    Ui::Dialog *ui;
private:
    UserManager* usermanager=new UserManager();
    Register* register_s=new Register(nullptr,this);
    menuview* menuview1=new menuview();
    admin* admin1=new admin();

};

#endif // DIALOG_H
